package com.demo.bean;

import org.springframework.beans.factory.annotation.Value;
import org.springframework.context.annotation.Scope;
import org.springframework.stereotype.Component;

@Component
@Scope("prototype")
public class MainFrame {
	@Value("4")
	private int memory;  //内存
	@Value("中国芯")
	private String cpu;
	@Value("3500.258")
	private double price;//价格
	public MainFrame() {
		super();
		System.out.println("======调用MainFrame无参构造方法=======");
	}
	public MainFrame(String cpu,int memory) {
		super();
		this.memory = memory;
		this.cpu = cpu;
	}
	public MainFrame(String cpu,double price){
		super();
		this.cpu = cpu;
		this.price = price;
	}
	
	public void work(){
		System.out.println("联想高端主机....");
		System.out.println("CPU:"+cpu);
		System.out.println("内存:"+memory);
		System.out.println("价格:"+price);
	}
	public int getMemory() {
		return memory;
	}
	public void setMemory(int memory) {
		System.out.println("调用setMemory方法=="+memory);
		this.memory = memory;
	}
	public String getCpu() {
		return cpu;
	}
	public void setCpu(String cpu) {
		System.out.println("调用setCpu方法=="+cpu);
		this.cpu = cpu;
	}
	
}
